<?php

class Skjb_Test_Suite
{
    public static function suite($class)
    {
        list($dir, $junk) = explode('_', $class);
        
        $suite = new PHPUnit_Framework_TestSuite($dir);
        
        $path = dirname(__FILE__) . '/../../../tests/' . $dir;
        
        $rows = scandir($path);
        foreach ($rows as $row) {
            if (substr($row, -3) == 'php' && $row != 'AllTests.php') {
                require_once $path . DIRECTORY_SEPARATOR . $row;
                $suite->addTestSuite($dir . '_' . substr($row, 0, -4));
            }
        }
        
        return $suite;
    }
}